/*
 * XML Type:  Invoice
 * Namespace: http://ofx.net/types/2003/04
 * Java type: net.ofx.types.x2003.x04.Invoice
 *
 * Automatically generated - do not modify.
 */
package net.ofx.types.x2003.x04.impl;
/**
 * An XML Invoice(@http://ofx.net/types/2003/04).
 *
 * This is a complex type.
 */
public class InvoiceImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements net.ofx.types.x2003.x04.Invoice
{
    
    public InvoiceImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName INVNO$0 = 
        new javax.xml.namespace.QName("", "INVNO");
    private static final javax.xml.namespace.QName INVTOTALAMT$2 = 
        new javax.xml.namespace.QName("", "INVTOTALAMT");
    private static final javax.xml.namespace.QName INVPAIDAMT$4 = 
        new javax.xml.namespace.QName("", "INVPAIDAMT");
    private static final javax.xml.namespace.QName INVDATE$6 = 
        new javax.xml.namespace.QName("", "INVDATE");
    private static final javax.xml.namespace.QName INVDESC$8 = 
        new javax.xml.namespace.QName("", "INVDESC");
    private static final javax.xml.namespace.QName DISCOUNT$10 = 
        new javax.xml.namespace.QName("", "DISCOUNT");
    private static final javax.xml.namespace.QName ADJUSTMENT$12 = 
        new javax.xml.namespace.QName("", "ADJUSTMENT");
    private static final javax.xml.namespace.QName LINEITEM$14 = 
        new javax.xml.namespace.QName("", "LINEITEM");
    
    
    /**
     * Gets the "INVNO" element
     */
    public java.lang.String getINVNO()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(INVNO$0, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "INVNO" element
     */
    public net.ofx.types.x2003.x04.InvestmentNumberType xgetINVNO()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.InvestmentNumberType target = null;
            target = (net.ofx.types.x2003.x04.InvestmentNumberType)get_store().find_element_user(INVNO$0, 0);
            return target;
        }
    }
    
    /**
     * Sets the "INVNO" element
     */
    public void setINVNO(java.lang.String invno)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(INVNO$0, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(INVNO$0);
            }
            target.setStringValue(invno);
        }
    }
    
    /**
     * Sets (as xml) the "INVNO" element
     */
    public void xsetINVNO(net.ofx.types.x2003.x04.InvestmentNumberType invno)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.InvestmentNumberType target = null;
            target = (net.ofx.types.x2003.x04.InvestmentNumberType)get_store().find_element_user(INVNO$0, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.InvestmentNumberType)get_store().add_element_user(INVNO$0);
            }
            target.set(invno);
        }
    }
    
    /**
     * Gets the "INVTOTALAMT" element
     */
    public java.lang.String getINVTOTALAMT()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(INVTOTALAMT$2, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "INVTOTALAMT" element
     */
    public net.ofx.types.x2003.x04.AmountType xgetINVTOTALAMT()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.AmountType target = null;
            target = (net.ofx.types.x2003.x04.AmountType)get_store().find_element_user(INVTOTALAMT$2, 0);
            return target;
        }
    }
    
    /**
     * Sets the "INVTOTALAMT" element
     */
    public void setINVTOTALAMT(java.lang.String invtotalamt)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(INVTOTALAMT$2, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(INVTOTALAMT$2);
            }
            target.setStringValue(invtotalamt);
        }
    }
    
    /**
     * Sets (as xml) the "INVTOTALAMT" element
     */
    public void xsetINVTOTALAMT(net.ofx.types.x2003.x04.AmountType invtotalamt)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.AmountType target = null;
            target = (net.ofx.types.x2003.x04.AmountType)get_store().find_element_user(INVTOTALAMT$2, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.AmountType)get_store().add_element_user(INVTOTALAMT$2);
            }
            target.set(invtotalamt);
        }
    }
    
    /**
     * Gets the "INVPAIDAMT" element
     */
    public java.lang.String getINVPAIDAMT()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(INVPAIDAMT$4, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "INVPAIDAMT" element
     */
    public net.ofx.types.x2003.x04.AmountType xgetINVPAIDAMT()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.AmountType target = null;
            target = (net.ofx.types.x2003.x04.AmountType)get_store().find_element_user(INVPAIDAMT$4, 0);
            return target;
        }
    }
    
    /**
     * Sets the "INVPAIDAMT" element
     */
    public void setINVPAIDAMT(java.lang.String invpaidamt)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(INVPAIDAMT$4, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(INVPAIDAMT$4);
            }
            target.setStringValue(invpaidamt);
        }
    }
    
    /**
     * Sets (as xml) the "INVPAIDAMT" element
     */
    public void xsetINVPAIDAMT(net.ofx.types.x2003.x04.AmountType invpaidamt)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.AmountType target = null;
            target = (net.ofx.types.x2003.x04.AmountType)get_store().find_element_user(INVPAIDAMT$4, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.AmountType)get_store().add_element_user(INVPAIDAMT$4);
            }
            target.set(invpaidamt);
        }
    }
    
    /**
     * Gets the "INVDATE" element
     */
    public java.lang.String getINVDATE()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(INVDATE$6, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "INVDATE" element
     */
    public net.ofx.types.x2003.x04.DateTimeType xgetINVDATE()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.DateTimeType target = null;
            target = (net.ofx.types.x2003.x04.DateTimeType)get_store().find_element_user(INVDATE$6, 0);
            return target;
        }
    }
    
    /**
     * Sets the "INVDATE" element
     */
    public void setINVDATE(java.lang.String invdate)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(INVDATE$6, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(INVDATE$6);
            }
            target.setStringValue(invdate);
        }
    }
    
    /**
     * Sets (as xml) the "INVDATE" element
     */
    public void xsetINVDATE(net.ofx.types.x2003.x04.DateTimeType invdate)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.DateTimeType target = null;
            target = (net.ofx.types.x2003.x04.DateTimeType)get_store().find_element_user(INVDATE$6, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.DateTimeType)get_store().add_element_user(INVDATE$6);
            }
            target.set(invdate);
        }
    }
    
    /**
     * Gets the "INVDESC" element
     */
    public java.lang.String getINVDESC()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(INVDESC$8, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "INVDESC" element
     */
    public net.ofx.types.x2003.x04.ShortMessageType xgetINVDESC()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.ShortMessageType target = null;
            target = (net.ofx.types.x2003.x04.ShortMessageType)get_store().find_element_user(INVDESC$8, 0);
            return target;
        }
    }
    
    /**
     * Sets the "INVDESC" element
     */
    public void setINVDESC(java.lang.String invdesc)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(INVDESC$8, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(INVDESC$8);
            }
            target.setStringValue(invdesc);
        }
    }
    
    /**
     * Sets (as xml) the "INVDESC" element
     */
    public void xsetINVDESC(net.ofx.types.x2003.x04.ShortMessageType invdesc)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.ShortMessageType target = null;
            target = (net.ofx.types.x2003.x04.ShortMessageType)get_store().find_element_user(INVDESC$8, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.ShortMessageType)get_store().add_element_user(INVDESC$8);
            }
            target.set(invdesc);
        }
    }
    
    /**
     * Gets the "DISCOUNT" element
     */
    public net.ofx.types.x2003.x04.Discount getDISCOUNT()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.Discount target = null;
            target = (net.ofx.types.x2003.x04.Discount)get_store().find_element_user(DISCOUNT$10, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * True if has "DISCOUNT" element
     */
    public boolean isSetDISCOUNT()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(DISCOUNT$10) != 0;
        }
    }
    
    /**
     * Sets the "DISCOUNT" element
     */
    public void setDISCOUNT(net.ofx.types.x2003.x04.Discount discount)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.Discount target = null;
            target = (net.ofx.types.x2003.x04.Discount)get_store().find_element_user(DISCOUNT$10, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.Discount)get_store().add_element_user(DISCOUNT$10);
            }
            target.set(discount);
        }
    }
    
    /**
     * Appends and returns a new empty "DISCOUNT" element
     */
    public net.ofx.types.x2003.x04.Discount addNewDISCOUNT()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.Discount target = null;
            target = (net.ofx.types.x2003.x04.Discount)get_store().add_element_user(DISCOUNT$10);
            return target;
        }
    }
    
    /**
     * Unsets the "DISCOUNT" element
     */
    public void unsetDISCOUNT()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(DISCOUNT$10, 0);
        }
    }
    
    /**
     * Gets the "ADJUSTMENT" element
     */
    public net.ofx.types.x2003.x04.Adjustment getADJUSTMENT()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.Adjustment target = null;
            target = (net.ofx.types.x2003.x04.Adjustment)get_store().find_element_user(ADJUSTMENT$12, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * True if has "ADJUSTMENT" element
     */
    public boolean isSetADJUSTMENT()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(ADJUSTMENT$12) != 0;
        }
    }
    
    /**
     * Sets the "ADJUSTMENT" element
     */
    public void setADJUSTMENT(net.ofx.types.x2003.x04.Adjustment adjustment)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.Adjustment target = null;
            target = (net.ofx.types.x2003.x04.Adjustment)get_store().find_element_user(ADJUSTMENT$12, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.Adjustment)get_store().add_element_user(ADJUSTMENT$12);
            }
            target.set(adjustment);
        }
    }
    
    /**
     * Appends and returns a new empty "ADJUSTMENT" element
     */
    public net.ofx.types.x2003.x04.Adjustment addNewADJUSTMENT()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.Adjustment target = null;
            target = (net.ofx.types.x2003.x04.Adjustment)get_store().add_element_user(ADJUSTMENT$12);
            return target;
        }
    }
    
    /**
     * Unsets the "ADJUSTMENT" element
     */
    public void unsetADJUSTMENT()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(ADJUSTMENT$12, 0);
        }
    }
    
    /**
     * Gets array of all "LINEITEM" elements
     */
    public net.ofx.types.x2003.x04.LineItem[] getLINEITEMArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(LINEITEM$14, targetList);
            net.ofx.types.x2003.x04.LineItem[] result = new net.ofx.types.x2003.x04.LineItem[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "LINEITEM" element
     */
    public net.ofx.types.x2003.x04.LineItem getLINEITEMArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.LineItem target = null;
            target = (net.ofx.types.x2003.x04.LineItem)get_store().find_element_user(LINEITEM$14, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "LINEITEM" element
     */
    public int sizeOfLINEITEMArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(LINEITEM$14);
        }
    }
    
    /**
     * Sets array of all "LINEITEM" element
     */
    public void setLINEITEMArray(net.ofx.types.x2003.x04.LineItem[] lineitemArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(lineitemArray, LINEITEM$14);
        }
    }
    
    /**
     * Sets ith "LINEITEM" element
     */
    public void setLINEITEMArray(int i, net.ofx.types.x2003.x04.LineItem lineitem)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.LineItem target = null;
            target = (net.ofx.types.x2003.x04.LineItem)get_store().find_element_user(LINEITEM$14, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(lineitem);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "LINEITEM" element
     */
    public net.ofx.types.x2003.x04.LineItem insertNewLINEITEM(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.LineItem target = null;
            target = (net.ofx.types.x2003.x04.LineItem)get_store().insert_element_user(LINEITEM$14, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "LINEITEM" element
     */
    public net.ofx.types.x2003.x04.LineItem addNewLINEITEM()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.LineItem target = null;
            target = (net.ofx.types.x2003.x04.LineItem)get_store().add_element_user(LINEITEM$14);
            return target;
        }
    }
    
    /**
     * Removes the ith "LINEITEM" element
     */
    public void removeLINEITEM(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(LINEITEM$14, i);
        }
    }
}
